package com.es.core.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * 描述:
 * Old-AgeCareSystem-公共异常处理类
 *
 * @author Derek
 * @create 2021-12-03 17:17
 */
//@ControllerAdvice
@Slf4j
public class ExceptionController {

    @ExceptionHandler
    public String exceptionHandler(Exception e, Model model){
        log.error(e.getMessage());
        model.addAttribute("errorMsg", e.getMessage());
        return "error/error";
    }
}
